package net.zdsoft.wpchat.support.enums;

/**
 * 权限群组类型枚举
 *
 * @author xuan
 */
public enum AuthGroupTypeEnum {
    SYSTEM(1), SPECIAL(2), CUSTOM(3);

    // 1：系统，2：系统特殊，10：自定义
    int value;

    public int getValue() {
        return value;
    }

    AuthGroupTypeEnum(int value) {
        this.value = value;
    }

    public static AuthGroupTypeEnum valueOf(int value) {
        AuthGroupTypeEnum type = null;
        switch (value) {
        case 1:
            type = SYSTEM;
            break;
        case 2:
            type = SPECIAL;
            break;
        case 3:
            type = CUSTOM;
            break;
        default:
            break;
        }
        return type;
    }

    public String getDescription() {
        String desc = null;
        switch (this) {
        case SYSTEM:
            desc = "系统";
            break;
        case SPECIAL:
            desc = "系统特殊";
            break;
        case CUSTOM:
            desc = "自定义";
            break;
        default:
            break;
        }
        return desc;
    }

    @Override
    public String toString() {
        return getDescription();
    }

    public boolean equals(AuthGroupTypeEnum type) {
        if (type == null) {
            return false;
        }
        return value == type.value;
    }

    public boolean equals(int value) {
        return this.value == value;
    }

}
